package networking.messages.syncMessages;

import com.jme.math.Vector3f;

import map.spawnStation.SpawnPosition;
import networking.messages.ProximityMessage;
import networking.messages.playerMessages.PlayerMessage;

public class NearStationChangeMessage extends PlayerMessage implements ProximityMessage {
	
	private int stationID;
	private Vector3f location;
	
	public NearStationChangeMessage() {
		super();
	}
	
	public NearStationChangeMessage(int playerID, SpawnPosition spawnPos) {
		super(playerID);
		
		if(spawnPos != null) {
			location = spawnPos.getLocalTranslation();
			stationID = spawnPos.getID();
		}
	}
	
	public int getStationID() { return stationID; }
	
	@Override
	public boolean applies() { return location != null; }
	
	@Override
	public Vector3f getLocation() { return location; }
}